interface ILengthwise {
  length: number;
}

// 使用继承的方式对参数提出要求
function loggingIdentity<T extends ILengthwise>(arg: T): T {
  console.log(arg.length);
  return arg;
}

loggingIdentity({length: 10, value: 3});

